layui.define(["layer", "laytpl", "form"], function (f) {
  var d = layui.$,
    e = layui.layer,
    g = layui.laytpl;
  b = function () {};
  b.prototype.viewTpl = function (a) {
    g(d(a.tpl).html()).render(a.data, function (c) {
      d(a.el).html(c);
    });
    "function" === typeof a.callback && a.callback(a.data);
    return this;
  };
  b.prototype.ajaxTpl = function (a) {
    a.url
      ? d.get(
          a.url,
          a.where || {},
          function (c) {
            c.status
              ? b.viewTpl({
                  tpl: a.tpl,
                  data: c.data,
                  el: a.el,
                  callback: a.callback
                })
              : e.msg(c.msg || a.msg);
          },
          "json"
        )
      : e.msg("URL\u9519\u8bef");
    return this;
  };
  var b = new b();
  f("app", b);
});
